package me.shiqiang.im.redis;

/**
 * @author cuishiqiang
 * @date 2017/12/16 下午2:26
 */
public class RedisKey {
    public static final String GROUP_ID = "group:ids";
    public static final String USER_ID = "user:ids";
    public static final String GROUP_USER_SET = "group_user_set:";
    public static final String SERVER_USERS = "server_users:";
    public static final String USER_SERVER_ID = "user_serverId:";
    public static final String GROUP_QUIT_USERS = "group_quit_users:";
    public static final String UID = "uid";
    public static final String SESSION= "session";
    public static final String CTYPE= "ctype";
    public static final String GROUP_SERVER_SET = "group_server_set:";
    public static final String SENSITIVE_VERSION = "sensitive_version";
    public static final String SERVICE_PLATFORM = "service_platform";
    public static final String SERVICE_PLATFORM_USERS = "service_platform_users";

    public static String serverUsersKey(String serverId){
        return SERVER_USERS+serverId;
    }

    public static String userServerId(String userId) {
        return USER_SERVER_ID+userId;
    }

    public static String groupUserSet(Long groupId) {
        return GROUP_USER_SET+groupId;
    }

    public static String groupQuitUsers(Long groupId) {
        return GROUP_QUIT_USERS+groupId;
    }

    public static String noDisturKey(Long uid, Long sessionId, int ctype) {
        return UID + uid + SESSION + sessionId + CTYPE + ctype;
    }

    public static String openedRoom(Long userId) {
        return userId + ":openedRoom";
    }

    public static String closedRoom(Long userId) {
        return userId + ":closedRoom";
    }

    public static String groupServerSet(String groupId) {
        return GROUP_SERVER_SET + groupId;
    }
}
